﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;

namespace VulnDBExplorer.Services.Impl {
	public class ShellExecutor {
		
		public StreamReader shellExecute(string program, string args, string workDir = "") {
			ProcessStartInfo info = new ProcessStartInfo();
			info.UseShellExecute = false;
			info.RedirectStandardOutput = true;
			info.FileName = program;
			info.CreateNoWindow = true;
			info.WorkingDirectory = workDir;
			info.Arguments = args;

			Process p = new Process() { StartInfo = info };
			p.Start();
			return p.StandardOutput;
		}
	}
}
